package com.ruoyi.vip.service.impl;

import com.ruoyi.vip.domain.Member;
import com.ruoyi.vip.mapper.MemberMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class MemberServiceImpl implements IMemberService{




    //    查数据
    @Autowired
    private MemberMapper memberMapper;

    @Override
    public List<Member> getList(Member member) {
        return memberMapper.selectMemberList(member);
    }

    //    删除数据
    @Override
    @Transactional
    public int deleteMemberByIds(Integer[] itemsId) {
        return memberMapper.deleteMemberByIds(itemsId);
    }

    //新增
    @Override
    @Transactional
    public int insertMember(Member member) {
        return memberMapper.insertMember(member);
    }


    //改

    @Override
    @Transactional
    public int updateMember(Member member) {
        return memberMapper.updateMember(member);
    }

    //ID 查
    @Override
    public Member getInfo(Integer id) {
        return memberMapper.getInfo(id);
    }


    @Override
    public  Member getInfoById( Integer   id) {
        return memberMapper.getInfoById(id);
    }

    @Override
    public Member getInfoByName(String name) {
        return memberMapper.getInfoByName(name);
    }
    @Override
    public Member getByPhoneNumber(String phoneNumber) {
        return memberMapper.getInfoByPhoneNumber(phoneNumber);
    }


}
